<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@include file="include.jsp" %>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<form method="post">
<ul class="form">

	<li>
		<label class="hd">姓名：</label>
        <p>如果不想通过伪属性配置，可以实例化Validation后用add方法增加要校验的字段</p>

	<input type="text" id="jjj"  data-valid="{required:true,email: ['用户名是一个邮箱']}">		
	
	<input data-valid="{email: ['用户名是一个邮箱'],style:'siderr'}" id="username" name="username" >
	</li>
	
	<li>
		<button type="submit">提交</button> 
	</li>
	
</ul>
</form>
<hr />
<script type="text/javascript">
KISSY.use("validation",function(S,Validation){
	 
    var form = S.query("form")[0],
     
        check = new Validation(form,{
            style: "under"
        });

   


    KISSY.Event.on(form,"submit",function(){
        check.isValid();
        return false;
    });
 
});

</script>
</body>
</html>